<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:include="admin/head :: head" th:with="title=配置管理编辑">
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <form class="layui-form" action="" lay-filter="formfilter">
            <div class="layui-form-item">
                <label class="layui-form-label">用户:</label>
                <div class="layui-input-inline">
                    <input type="text" readonly="readonly" class="layui-input" th:value="${ m.userName}">
                </div>
                <label class="layui-form-label">币种名称:</label>
                <div class="layui-input-inline">
                    <input type="text" readonly="readonly" class="layui-input" th:value="${ m.currencyName}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">申请数量:</label>
                <div class="layui-input-inline">
                    <input type="text" readonly="readonly" class="layui-input" th:value="${ m.quantity}">
                </div>
                <label class="layui-form-label">实际到账数量:</label>
                <div class="layui-input-inline">
                    <input type="text" readonly="readonly" class="layui-input" th:value="${ m.realQuantity}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">地址:</label>
                <div class="layui-input-block">
                    <input type="text" readonly="readonly" class="layui-input" th:value="${ m.address}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">申请时间:</label>
                <div class="layui-input-block">
                    <input type="text" readonly="readonly" class="layui-input" th:value="${#dates.format(m.createTime,'yyyy-MM-dd HH:mm:ss')}" >
                </div>
            </div><div class="layui-form-item">
            <label class="layui-form-label">标签:</label>
            <div class="layui-input-block">
                <input type="text" readonly="readonly" class="layui-input" th:value="${ m.memo}">
            </div>
        </div>
            <div class="layui-form-item">
                <label class="layui-form-label">交易hash:</label>
                <div class="layui-input-block">
                    <input type="text" readonly="readonly" class="layui-input" th:value="${ m.hash}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">理由:</label>
                <div class="layui-input-block">
                    <input type="text" name="reason" class="layui-input" th:value="${ m.reason}">
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="hidden" name="id" th:value="${ m.id}">
                    <button class="layui-btn" lay-submit="" lay-filter="formSubmit">同意</button>
                    <button class="layui-btn layui-btn-warm" lay-submit="" lay-filter="formSubmit2">拒绝</button>
                </div>
            </div>
        </form>
    </div>
</div>

<script>
    layui.use(['layedit', 'layer', 'jquery','liuQi'], function () {
        var form = layui.form,
            liuQi = layui.liuQi,
            laydate = layui.laydate;

        //日期
        form.render();

        //自定义验证规则
        form.verify({
            name: function (value) {
            },
            val: function (value) {
            },
            remarks: function (value) {
            },
            type: function (value) {
            },
        });
        //监听提交
        form.on('submit(formSubmit)', function (data) {
            data=data.field;
            layer.confirm("是否确认提币?",function (obj) {
                liuQi.ajax("/admin/extract/confirm",data,
                    function (data) {
                        //关闭
                        parent.layer.msg(data.msg);
                        parent.layui.table.reload('currentTableId');
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                    }
                );
            });
            return false;
        });
        form.on('submit(formSubmit2)', function (data) {
            data=data.field;
            layer.confirm("是否确认拒绝提币?",function (obj) {
                liuQi.ajax("/admin/extract/refuse", data,
                    function (data) {
                        //关闭
                        parent.layer.msg(data.msg);
                        parent.layui.table.reload('currentTableId');
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                    }
                );
            });
            return false;
        });
    });
</script>

</body>
</html>